package com.esm.daoimpl;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import com.esm.dao.SignDao;
import com.esm.utils.JDBCUtil;

public class SignDaoImpl implements SignDao{

	@Override
	public boolean addStartTime(int uid, String start, String sgroup) {
		boolean flag=false;
		StringBuffer sql=new StringBuffer("INSERT INTO ems_sign (uid,startTime,sgroup) ");
		sql.append(" VALUES (?,?,?)");
		Connection conn=JDBCUtil.getConnection();
		try {
			PreparedStatement ps=conn.prepareStatement(sql.toString());
			ps.setInt(1, uid);
			ps.setString(2, start);
			ps.setString(3, sgroup);
			int i=ps.executeUpdate();
			if(i!=0){
				flag=true;
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return flag;
	}

}
